From 27950be750962e9f92f86b6cfc579bd3443a7b59 Mon Sep 17 00:00:00 2001 From: Liangent Date: Fri, 21 Dec 2012 17:55:57 +0800 Subject: [PATCH] Use proper function recursiveConvertTopLevel() in recursive conversion so that conversion of alt and title attrs doesn't clear converter state. Change-Id: Icb6e5e1fa71768ac306c9ac4bca9f58845a3e457 --- languages/LanguageConverter.php | 2 +- tests/parser/parserTests.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index fed8835f7b..43afe65326 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -410,7 +410,7 @@ class LanguageConverter { $attr = $attrs[$attrName]; // Don't convert URLs if ( !strpos( $attr, '://' ) ) { - $attr = $this->convertTo( $attr, $toVariant ); + $attr = $this->recursiveConvertTopLevel( $attr, $toVariant ); } // Remove HTML tags to avoid disrupting the layout diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index af4d218e08..6bf564d622 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -10987,6 +10987,20 @@ China

!! end +!! test +Recursive conversion of alt and title attrs shouldn't clear converter state +!! options +language=zh variant=zh-cn showtitle +!! input +-{H|zh-cn:Exclamation;zh-tw:exclamation;}- +Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-! +!! result +China +

+Should be stripped! +

+!! end + !! test Bug 24072: more test on conversion rule for title !! options -- 2.20.1